package cn.assumejson.springframework.aop;

/**
 * @author Mr. Li
 * @version 1.0
 * @since 1.0 2021/12/2 13:55
 */
public interface TargetSource extends TargetClassAware {

    /**
     * Return the type of targets returned by this {@link TargetSource}.
     * <p>Can return <code>null</code>, although certain usages of a
     * <code>TargetSource</code> might just work with a predetermined
     * target class.
     *
     * @return the type of targets returned by this {@link TargetSource}
     */
    Class<?> getTargetClass();

    /**
     * Return a target instance. Invoked immediately before the
     * AOP framework calls the "target" of an AOP method invocation.
     *
     * @return the target object, which contains the joinpoint
     * @throws Exception if the target object can't be resolved
     */
    Object getTarget();

}
